package com.pingan.cashier.web;

import com.pingan.cashier.service.AccountFlowService;
import com.pingan.cashier.web.req.AccountFlowReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@RequestMapping("/account_flow")
@RestController
public class AccountFlowController {

    @Autowired
    private AccountFlowService accountFlowService;

    @PostMapping("/add")
    public void addAccountFlow(@RequestBody AccountFlowReq accountFlowReq){
        accountFlowService.addAccountFlow(accountFlowReq);
    }

    @GetMapping("/test")
    public void test(){
        AccountFlowReq accountFlowReq = new AccountFlowReq();
        accountFlowReq.setBizNo("No123");
        accountFlowReq.setTransAmount(BigDecimal.valueOf(10000));
        accountFlowReq.setBizTitle("转账测试");
        accountFlowReq.setBizScene("1");
        accountFlowReq.setFromAccountId("123");
        accountFlowReq.setToAccountId("456");
        addAccountFlow(accountFlowReq);
    }
}
